<!--
 * @Author: 张鹏
 * @Date: 2025-07-04 09:53:55
 * @LastEditors: fyukeeh 15849141465@163.com
 * @LastEditTime: 2025-08-01 10:44:10
 * @FilePath: \mapbox\src\views\Home.vue
 * @Description: 
 * 
-->
<template>
    <div class="home-page" id="home-bg">
        <ParticleBackground />
        <div class="header">
            <h1 class="title">MapLibre-GL 地图工具</h1>
            <p class="subtitle">持续更新中...</p>
        </div>

        <div class="content">
            <div class="cards-container">
                <div v-for="(item, index) in exampleData" :key="index" class="card"
                    @click="() => router.push(item.link)">
                    <div class="card-icon">
                        <span class="icon-emoji">{{ item.icon }}</span>
                    </div>
                    <div class="card-content">
                        <h3 class="card-title">{{ item.title }}</h3>
                        <p class="card-description">{{ item.description }}</p>
                    </div>
                    <div class="card-arrow">
                        <el-icon>
                            <ArrowRight />
                        </el-icon>
                    </div>
                </div>
            </div>
        </div>

        <div class="footer">
            <div class="author-info">
                <p class="author-text">
                    <span class="author-label">Author：</span>
                    <span class="author-name">ZhangPeng</span>
                </p>
            </div>
        </div>
    </div>
</template>
<script setup>
import { reactive } from 'vue';
import { useRouter } from 'vue-router';
import { ArrowRight } from '@element-plus/icons-vue';
import ParticleBackground from '@/components/ParticleBackground.vue';

const router = useRouter();

const exampleData = reactive([
    {
        title: '标记点',
        link: '/BillboardEntity',
        description: '在地图上添加和管理标记点',
        icon: '📍'
    },
    {
        title: '军标',
        link: '/Arrow',
        description: '军事标绘符号绘制工具',
        icon: '🎯'
    },
    {
        title: '点、线、面',
        link: '/PointLinePolygon',
        description: '基础几何图形绘制功能',
        icon: '📐'
    },
    {
        title: '标绘',
        link: '/Draw',
        description: '自由绘制和编辑工具',
        icon: '✏️'
    },
    {
        title: '分屏',
        link: '/SplitScreen',
        description: '多视图分屏显示功能',
        icon: '🖥️'
    },
    {
        title: '动态样式切换',
        link: '/DynamicStyle',
        description: '根据缩放级别自动切换地图样式',
        icon: '🌈'
    },
    {
        title: '轨迹回放',
        link: '/TrajectoryPlayback',
        description: '演示轨迹回放功能，支持播放、暂停、进度、速度调节',
        icon: '🚗'
    },
    {
        title: '卫星轨道',
        link: '/SatelliteDemo',
        description: '3D球体卫星轨道与卫星运动演示',
        icon: '🛰️'
    },
    {
        title: '天地图底图切换',
        link: '/TiandituBasemap',
        description: '天地图矢量、影像、地形底图一键切换示例',
        icon: '🗺️'
    },
    {
        title: '3D模型加载',
        link: '/ThreeModelExample',
        description: '在地图上加载和展示3D模型',
        icon: '🗿'
    },
    {
        title: '材质自定义',
        link: '/MaterialDemo',
        description: '演示实体材质自定义功能，支持颜色、透明度、边框等属性编辑',
        icon: '🎨'
    },
    {
        title: '3D建筑显示',
        link: '/Buildings3D',
        description: '使用MapTiler矢量瓦片 + fill-extrusion显示3D建筑效果',
        icon: '🏢'
    },
    {
        title: '所有实体演示',
        link: '/AllEntitiesDemo',
        description: '展示所有支持的实体类型及其用法',
        icon: '🧩'
    },
    {
        title: '雷达扫描',
        link: '/RadarScanExample',
        description: '3D雷达动态扫描演示',
        icon: '📡'
    },
    {
        title: '围墙边界',
        link: '/BoundaryWallExample',
        description: '3D围墙边界效果，支持不规则多边形边界绘制',
        icon: '🏗️'
    }
]);
</script>
<style lang="scss" scoped>
.home-page {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(270deg, #667eea, #43cea2, #ff6a00, #ee0979, #764ba2, #667eea);
    background-size: 1200% 1200%;
    animation: gradient-move 18s ease-in-out infinite;
    padding: 0;
    display: flex;
    flex-direction: column;
}

@keyframes gradient-move {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

// 让内容在canvas之上
.header, .content, .footer {
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    padding: 60px 20px 40px;
    color: white;

    .title {
        font-size: 3rem;
        font-weight: 700;
        margin-bottom: 16px;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        letter-spacing: 1px;
    }

    .subtitle {
        font-size: 1.2rem;
        opacity: 0.9;
        font-weight: 300;
        max-width: 600px;
        margin: 0 auto;
        line-height: 1.6;
    }
}

.content {
    flex: 1;
    padding: 0 20px 40px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1200px;
    width: 100%;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 32px 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #667eea, #764ba2);
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }

    &:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);

        &::before {
            transform: scaleX(1);
        }

        .card-arrow {
            transform: translateX(8px);
            opacity: 1;
        }

        .card-icon {
            transform: scale(1.1);
        }
    }
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: transform 0.3s ease;

    .icon-emoji {
        font-size: 28px;
        color: white;
        display: block;
    }
}

.card-content {
    flex: 1;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-description {
    color: #7f8c8d;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.card-arrow {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 32px;
    height: 32px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;

    .el-icon {
        color: #667eea;
        font-size: 16px;
    }
}

// 响应式设计
@media (max-width: 768px) {
    .header {
        padding: 40px 20px 30px;

        .title {
            font-size: 2.2rem;
        }

        .subtitle {
            font-size: 1rem;
        }
    }

    .cards-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        padding: 24px 20px;
    }

    .card-icon {
        width: 50px;
        height: 50px;

        .icon-emoji {
            font-size: 24px;
        }
    }

    .card-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .header .title {
        font-size: 1.8rem;
    }

    .content {
        padding: 0 16px 30px;
    }
}

.footer {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.author-info {
    max-width: 600px;
    margin: 0 auto;
}

.author-text {
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.author-label {
    font-weight: 500;
    margin-right: 8px;
}

.author-name {
    font-weight: 600;
    color: #fff;
    margin-right: 12px;
}

.author-email {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}


@media (max-width: 768px) {
    .footer {
        padding: 16px;
    }

    .author-text {
        font-size: 0.9rem;
    }

}
</style>